<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>宠物信息</title>


    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">


    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>

</head>
<style>
    body{
        height: 600px;
        width: 700px;
        margin: 40px auto;
    }
    #one{
        text-align: center;
        margin-bottom: 20px;
    }
</style>
<form th:action="@{/findByName}" id="one">
    品种：<select name="petbreed">
    <option value="0">--请选择--</option>
    <option value="1">狗</option>
    <option value="2">猫</option>
    <option value="3">鸟</option>
    <option value="4">兔</option>
    </select>
  <input type="submit" value="查询">
    <a th:href="@{/toAdd}">新增宠物</a>
</form>
<div>
    <table class="table table-bordered">
        <tr>
            <th>宠物昵称</th>
            <th>出生日期</th>
            <th>性别</th>
        </tr>
        <tr th:each="li : ${list}">
            <td th:text="${li.petname}"></td>
            <td th:text="${#dates.format(li.birthday,'yyyy-MM-dd')}"></td>
            <td>
                <span th:if="${li.petsex==1}">雄</span>
                <span th:if="${li.petsex==2}">雌</span>
            </td>
        </tr>
    </table>
</div>


<body>


<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
</body>
</html>